<template>
	<div class="">
		<bread-crumb>我參與的賽事</bread-crumb>
		<div class="uc-body">
			<!--篩選控制-->
			<div class="manage-list">
				<div class="manage-list-item" v-for="(item,index) in reviewVoteList " :key="item.id">
					<div class="info-bar">
						<div>{{item.contestMaster}}VS{{item.contestBranch}}（{{item.infoName}}）</div>
						<el-button circle icon="el-icon-right" type="success" size="small" @click="jumpDetail(item.playId)"></el-button>
					</div>
					<div class="line"></div>
					<div>
						<div class="info-row ">
							首次參與時間：
							<span class="f16">{{item.betTime }}</span>
						</div>
						<div class="info-row ">
							下注幣種：
							<span class=" f16">
								{{item.trcInfo.trcName}}/{{item.trcInfo.symbol}}
							</span>
						</div>

						<div class="info-row ">
							參與下註：
							<span class=" f16">{{item.participate}}次</span>
						</div>

						<div class="info-row ">
							共下注幣：
							<span class=" f16">
								{{parseFloat(item.sum_amount / Math.pow(10, item.trcInfo.decimal)).toFixed(2)}}
								個</span>
						</div>

						<div class="info-row"></div>
					</div>
				</div>
			</div>
		</div>
		<!--******************************************* 結果填寫彈層 ***********************************************-->

	</div>
</template>

<script>

	//数据
	import breadCrumb from '../components/breadCrumb.vue'
	import { mixins } from '@/mixins/mixins'
	import { mixinsUtils } from '@/mixins/mixins.utils'
	import { mixinsManage } from "@/views/manage/js/manage.mixins";
	import { contestMixinsGlobal} from '@/views/contestHall/contest.mixins.global'
	import util from "@/libs/util";
	import { mapGetters } from "vuex";
	import {apiToBeManageGame} from "./js/manage.user.lib";

	const debounce = util.debounce(1000) //初始化个防抖对象

	//导出
	export default {
		name:"manageMyInvolvedGame",
		components: { breadCrumb},
		mixins:[mixins,mixinsUtils,mixinsManage,contestMixinsGlobal],
		data () {
			return {
				/////////////////////////////////////////////////////////////////
				loading:false,
				visibleSettle: false,//弹层显示
				submiting    : false,//是否提交中
				timestampNow : 0,
				listDataCount: 0,//数量
				//////////////////////////////////////////////////////////////////
				//请求参数
				requestParameter: {
					sender: this.sender
				},
				//数据列表
				reviewVoteList:[],
				//基础数据对象,
				voteObject:{
					sportingInfo:{
						rs:[] //初始化这个值，以免出错
					}
				},
			}
		},
		computed:{
			...mapGetters(['isSuperUser']),
		},
		created () {
			this.pageInit()
		},
		mounted () {
		},
		methods:{
			//初始化
			pageInit(){
				this.getToBeManageGame()//加载数据
			},
			//跳转到赛事详情
			jumpDetail(play_id) {
				console.log(play_id)
				this.$router.push('/contest/'+play_id)
			},
			//获取待复核结果的投票列表数据
			getToBeManageGame () {
				let that = this;
				this.requestParameter.sender = this.sender;
				apiToBeManageGame({
					...this.requestParameter
				}, (res) => {
					if (res.resultFlag) {
						this.listDataCount  = res.count
						this.reviewVoteList = res.data
						let _idArr =  this.reviewVoteList.reduce((ret,cur) => {
							ret.push(cur.sportingId)
							return ret
						},[])
						// that.viewProposalInfo(_idArr, this.reviewVoteList);

					}
				})
			},

			////////////////////////////////////////////////////////////////////////////////////////////////////////
			////////////////////////////////////////////////////////////////////////////////////////////////////////
			////////////////////////////////////////////////////////////////////////////////////////////////////////
			//刷新，筛选
			reFresh () {
				this.showLoading()
				debounce(()=> {
					this.getToBeManageGame()
					setTimeout(() => {
						this.hideLoading()
					},100)
				})
			},

			//显示操作层
			actShowDialog(id){
				let that = this;
				this.voteObject = this.reviewVoteList.find((item) => {
					if (parseInt(item.proposalId) == id) {
						that.voteObject = item;
						return item
					}
				})
				this.visibleSettle = true
			},

			//关闭结果填写,如果绑定了关闭回调，则要调用done()
			onCloseResultWrite(done){
				done()
			},
		}
	}
</script>

<style lang="less" scoped>
    /*公共变量*/
    @import '~@/assets/global.less';
    //单独控制弹层样式细节
    .dialog-detail-module {
        font-size: 16px;
    .module-wrap {
    .v-row {padding:3px 0;}
    }
    .btn-group{
    }
    }
    /************************************适应***************************************/
    @media screen and (max-width: @MINSCREEN){

    }
</style>